package org.yray.bytebuddy;

import net.bytebuddy.agent.builder.AgentBuilder;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.dynamic.DynamicType;
import net.bytebuddy.utility.JavaModule;

public class MyListener implements AgentBuilder.Listener{

        @Override
        public void onDiscovery(String typeName,ClassLoader classLoader,JavaModule module,boolean loaded){
            System.out.println("onDiscovery:");
        }



        @Override
        public void onTransformation(TypeDescription typeDescription,ClassLoader classLoader,JavaModule module,
        boolean loaded,DynamicType dynamicType){
        //修改后的类输出
            System.out.println("onTransformation:");
        }

        @Override
        public void onIgnored(TypeDescription typeDescription,ClassLoader classLoader,JavaModule module,
        boolean loaded){
            System.out.println("onIgnored:");
        }

        @Override
        public void onError(String typeName,ClassLoader classLoader,JavaModule module,boolean loaded,
        Throwable throwable){
            System.out.println("onError:");
        }

        @Override
        public void onComplete(String typeName,ClassLoader classLoader,JavaModule module,boolean loaded){
            System.out.println("onComplete:");
        }


}
